/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.bicycle.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * BlueBike用户Entity
 * @author 谢宇燊
 * @version 2020-04-07
 */
@Table(name="bicycle_user", alias="a", columns={
		@Column(name="id", attrName="id", label="用户id", isPK=true),
		@Column(name="name", attrName="name", label="用户姓名", queryType=QueryType.LIKE),
		@Column(name="login_code", attrName="loginCode", label="用户登录号", isQuery=false),
		@Column(name="student_num", attrName="studentNum", label="用户学号/工号"),
		@Column(name="password", attrName="password", label="用户密码", isQuery=false),
		@Column(name="phone", attrName="phone", label="用户手机", isQuery=false),
		@Column(name="borrow_status", attrName="borrowStatus", label="用户借车状态", isQuery=false),
		@Column(name="bicycle_num", attrName="bicycleNum", label="所借单车编号", isQuery=false),
		@Column(name="created_time", attrName="createdTime", label="创建时间", isQuery=false),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="updated_by", attrName="updatedBy", label="更新者", isQuery=false),
		@Column(name="updated_time", attrName="updatedTime", label="更新时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
	}, orderBy="a.id DESC"
)
public class BicycleUser extends DataEntity<BicycleUser> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 用户姓名
	private String loginCode;		// 用户登录号
	private String studentNum;		// 用户学号/工号
	private String password;		// 用户密码
	private String phone;		// 用户手机
	private Integer borrowStatus;		// 用户借车状态
	private String bicycleNum;		// 所借单车编号
	private Date createdTime;		// 创建时间
	private Date updatedBy;		// 更新者
	private String updatedTime;		// 更新时间
	
	public BicycleUser() {
		this(null);
	}

	public BicycleUser(String id){
		super(id);
	}
	
	@NotBlank(message="用户姓名不能为空")
	@Length(min=0, max=10, message="用户姓名长度不能超过 10 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@NotBlank(message="用户登录号不能为空")
	@Length(min=0, max=100, message="用户登录号长度不能超过 100 个字符")
	public String getLoginCode() {
		return loginCode;
	}

	public void setLoginCode(String loginCode) {
		this.loginCode = loginCode;
	}
	
	@NotBlank(message="用户学号/工号不能为空")
	@Length(min=0, max=100, message="用户学号/工号长度不能超过 100 个字符")
	public String getStudentNum() {
		return studentNum;
	}

	public void setStudentNum(String studentNum) {
		this.studentNum = studentNum;
	}
	
	@NotBlank(message="用户密码不能为空")
	@Length(min=0, max=100, message="用户密码长度不能超过 100 个字符")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	@Length(min=0, max=100, message="用户手机长度不能超过 100 个字符")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public Integer getBorrowStatus() {
		return borrowStatus;
	}

	public void setBorrowStatus(Integer borrowStatus) {
		this.borrowStatus = borrowStatus;
	}
	
	@Length(min=0, max=255, message="所借单车编号长度不能超过 255 个字符")
	public String getBicycleNum() {
		return bicycleNum;
	}

	public void setBicycleNum(String bicycleNum) {
		this.bicycleNum = bicycleNum;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(Date updatedBy) {
		this.updatedBy = updatedBy;
	}
	
	@Length(min=0, max=64, message="更新时间长度不能超过 64 个字符")
	public String getUpdatedTime() {
		return updatedTime;
	}

	public void setUpdatedTime(String updatedTime) {
		this.updatedTime = updatedTime;
	}
	
}